import axios from 'axios'

const baseUrl = 'http://101.43.184.135:3001'


export function get(url){
    return function(params = {}){
        return axios.get(baseUrl + url,{
            params
        }).then(res => {
            const{ data } = res.data
                return data
        }).catch(err => {
            // console.log(err);
            return err
        })
    }
}
export function post(url){
  return function(params = {}){
      return axios.post(baseUrl + url,{
          params
      }).then(res => {
        const data  = res.data
        // console.log(data);
        return data
      }).catch(err => {
          // console.log(err);
          return err
      })
  }
}